| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.dgtly.system.mapper.SysCompanyMapper">
-
- <resultMap type="SysCompany" id="SysCompanyResult">
- <result property="id" column="id" />
- <result property="status" column="status" />
- <result property="companyName" column="company_name" />
- <result property="companyType" column="company_type" />
- <result property="detailAddress" column="detail_address" />
- <result property="longitude" column="longitude" />
- <result property="latitude" column="latitude" />
- <result property="legalPerson" column="legal_person" />
- <result property="contactNumber" column="contact_number" />
- <result property="establishDate" column="establish_date" />
- <result property="unifiedSocialCreditCode" column="unified_social_credit_code" />
- <result property="businessLicenseUrl" column="business_license_url" />
- <result property="defaultImgUrl" column="default_img_url" />
- <result property="propagandaImgUrl" column="propaganda_img_url" />
- <result property="companyIntroduce" column="company_introduce" />
- <result property="versionNum" column="version_num" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- <result property="primaryBusiness" column="primary_business" />
- </resultMap>
- <sql id="selectSysCompanyVo">
- select id, company_name,company_type,detail_address,longitude,latitude,legal_person,contact_number,establish_date,
- unified_social_credit_code,business_license_url,default_img_url,propaganda_img_url,company_introduce,version_num,
- create_by,update_by,update_time,remark,status,create_time,primary_business
- from sys_company
- </sql>
- <select id="selectSysCompanyList" parameterType="SysCompany" resultMap="SysCompanyResult">
- <include refid="selectSysCompanyVo"/>
- <where>
- <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName},'%')</if>
- <if test="status != null and status != ''">and status =#{status}</if>
- <if test="companyType != null and companyType != ''">and companyType =#{company_type}</if>
- </where>
- </select>
-
- <select id="selectSysCompanyById" parameterType="Long" resultMap="SysCompanyResult">
- <include refid="selectSysCompanyVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertSysCompany" parameterType="SysCompany" useGeneratedKeys="true" keyProperty="id">
- insert into sys_company
- <trim prefix="(" suffix=")" suffixOverrides=",">
- create_time,
- <if test="status != null and status != ''">status,</if>
- <if test="companyName != null and companyName != ''">company_name,</if>
- <if test="companyType != null and companyType != ''">company_type,</if>
- <if test="detailAddress != null and detailAddress != ''">detail_address,</if>
- <if test="longitude != null and longitude != ''">longitude,</if>
- <if test="latitude != null and latitude != ''">latitude,</if>
- <if test="legalPerson != null and legalPerson != ''">legal_person,</if>
- <if test="contactNumber != null and contactNumber != ''">contact_number,</if>
- <if test="establishDate != null ">establish_date,</if>
- <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''">unified_social_credit_code,</if>
- <if test="businessLicenseUrl != null and businessLicenseUrl != ''">business_license_url,</if>
- <if test="defaultImgUrl != null and defaultImgUrl != ''">default_img_url,</if>
- <if test="propagandaImgUrl != null and propagandaImgUrl != ''">propaganda_img_url,</if>
- <if test="companyIntroduce != null and companyIntroduce != ''">company_introduce,</if>
- <if test="versionNum != null and versionNum != ''">version_num,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- <if test="updateBy != null and updateBy != ''">update_by,</if>
- <if test="remark != null and remark != ''">remark,</if>
- <if test="primaryBusiness != null and primaryBusiness != ''">primary_business,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- now(),
- <if test="status != null and status != ''">#{status},</if>
- <if test="companyName != null and companyName != ''">#{companyName},</if>
- <if test="companyType != null and companyType != ''">#{companyType},</if>
- <if test="detailAddress != null and detailAddress != ''">#{detailAddress},</if>
- <if test="longitude != null and longitude != ''">#{longitude},</if>
- <if test="latitude != null and latitude != ''">#{latitude},</if>
- <if test="legalPerson != null and legalPerson != ''">#{legalPerson},</if>
- <if test="contactNumber != null and contactNumber != ''">#{contactNumber},</if>
- <if test="establishDate != null ">#{establishDate},</if>
- <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''">#{unifiedSocialCreditCode},</if>
- <if test="businessLicenseUrl != null and businessLicenseUrl != ''">#{businessLicenseUrl},</if>
- <if test="defaultImgUrl != null and defaultImgUrl != ''">#{defaultImgUrl},</if>
- <if test="propagandaImgUrl != null and propagandaImgUrl != ''">#{propagandaImgUrl},</if>
- <if test="companyIntroduce != null and companyIntroduce != ''">#{companyIntroduce},</if>
- <if test="versionNum != null and versionNum != ''">#{versionNum},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
- <if test="remark != null and remark != ''">#{remark},</if>
- <if test="primaryBusiness != null and primaryBusiness != ''">#{primaryBusiness},</if>
- </trim>
- </insert>
- <update id="updateSysCompany" parameterType="SysCompany">
- update sys_company
- <trim prefix="SET" suffixOverrides=",">
- update_time = now(),
- <if test="status != null">status = #{status},</if>
- <if test="companyName != null and companyName != ''">company_name= #{companyName},</if>
- <if test="companyType != null and companyType != ''">company_type= #{companyType},</if>
- <if test="detailAddress != null and detailAddress != ''">detail_address= #{detailAddress},</if>
- <if test="longitude != null and longitude != ''">longitude= #{longitude},</if>
- <if test="latitude != null and latitude != ''">latitude= #{latitude},</if>
- <if test="legalPerson != null and legalPerson != ''">legal_person= #{legalPerson},</if>
- <if test="contactNumber != null and contactNumber != ''">contact_number= #{contactNumber},</if>
- <if test="establishDate != null ">establish_date= #{establishDate},</if>
- <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''">unified_social_credit_code= #{unifiedSocialCreditCode},</if>
- <if test="businessLicenseUrl != null and businessLicenseUrl != ''">businessLicenseUrl= #{businessLicenseUrl},</if>
- <if test="defaultImgUrl != null and defaultImgUrl != ''">default_img_url= #{defaultImgUrl},</if>
- <if test="propagandaImgUrl != null and propagandaImgUrl != ''">propaganda_img_url= #{propagandaImgUrl},</if>
- <if test="companyIntroduce != null and companyIntroduce != ''">company_introduce= #{companyIntroduce},</if>
- <if test="versionNum != null and versionNum != ''">version_num= #{versionNum},</if>
- <if test="createBy != null and createBy != ''">create_by= #{createBy},</if>
- <if test="updateBy != null and updateBy != ''">update_by= #{updateBy},</if>
- <if test="remark != null and remark != ''">remark= #{remark},</if>
- <if test="primaryBusiness != null and primaryBusiness != ''">primary_business=#{primaryBusiness},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteSysCompanyById" parameterType="Long">
- delete from sys_company where id = #{id}
- </delete>
- <delete id="deleteSysCompanyByIds" parameterType="String">
- delete from sys_company where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectCompanyHotList" resultMap="SysCompanyResult">
- select sc.id, sc.company_name,sc.establish_date,sc.default_img_url,sc.primary_business
- from sys_company sc
- where sc.id != 1 and sc.status = 0
- limit 0,5
- </select>
- <select id="selectSysCompanyListExRoot" parameterType="SysCompany" resultMap="SysCompanyResult">
- <include refid="selectSysCompanyVo"/>
- <where>
- id !=1
- <if test="companyName != null and companyName != ''"> and company_name = #{companyName}</if>
- </where>
- </select>
-
- </mapper>
|