| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.enterprise.modules.base.dao.CompanyInfoDAO">
- <resultMap id="CompanyInfoMap" type="com.jpsoft.enterprise.modules.base.entity.CompanyInfo">
- <id property="id" column="id_" />
- <result property="companyName" column="company_name" />
- <result property="type" column="type_" />
- <result property="logoUrl" column="logo_url"/>
- <result property="creditCode" column="credit_code" />
- <result property="address" column="address_" />
- <result property="businessLicenseUrl" column="business_license_url" />
- <result property="scale" column="scale_" />
- <result property="industry" column="industry_" />
- <result property="region" column="region_" />
- <result property="companyIntroduction" column="company_introduction" />
- <result property="enterpriserIntroduction" column="enterpriser_introduction" />
- <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="delFlag" column="del_flag" />
- <result property="industryName" column="industry_name" />
- <result property="position" column="position_" />
- <result property="inside" column="inside_"/>
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.CompanyInfo">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_company_info
- (id_,company_name,type_,logo_url,credit_code,address_,business_license_url,scale_,industry_,region_,company_introduction,enterpriser_introduction,create_by,create_time,update_by,update_time,del_flag,position_,inside_)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{companyName,jdbcType=VARCHAR}
- ,#{type,jdbcType=VARCHAR}
- ,#{logoUrl,jdbcType=VARCHAR}
- ,#{creditCode,jdbcType=VARCHAR}
- ,#{address,jdbcType=VARCHAR}
- ,#{businessLicenseUrl,jdbcType=VARCHAR}
- ,#{scale,jdbcType=VARCHAR}
- ,#{industry,jdbcType=VARCHAR}
- ,#{region,jdbcType=VARCHAR}
- ,#{companyIntroduction,jdbcType=VARCHAR}
- ,#{enterpriserIntroduction,jdbcType=VARCHAR}
- ,#{createBy,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{position,jdbcType=VARCHAR}
- ,#{inside,jdbcType=NUMERIC}
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_company_info where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.CompanyInfo">
- update base_company_info
- <set>
- <if test="companyName!=null">
- company_name=#{companyName,jdbcType=VARCHAR},
- </if>
- <if test="type!=null">
- type_=#{type,jdbcType=VARCHAR},
- </if>
- <if test="logoUrl!=null">
- logo_url=#{logoUrl,jdbcType=VARCHAR},
- </if>
- <if test="creditCode!=null">
- credit_code=#{creditCode,jdbcType=VARCHAR},
- </if>
- <if test="address!=null">
- address_=#{address,jdbcType=VARCHAR},
- </if>
- <if test="businessLicenseUrl!=null">
- business_license_url=#{businessLicenseUrl,jdbcType=VARCHAR},
- </if>
- <if test="scale!=null">
- scale_=#{scale,jdbcType=VARCHAR},
- </if>
- <if test="industry!=null">
- industry_=#{industry,jdbcType=VARCHAR},
- </if>
- <if test="region!=null">
- region_=#{region,jdbcType=VARCHAR},
- </if>
- <if test="companyIntroduction!=null">
- company_introduction=#{companyIntroduction,jdbcType=VARCHAR},
- </if>
- <if test="enterpriserIntroduction!=null">
- enterpriser_introduction=#{enterpriserIntroduction,jdbcType=VARCHAR},
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="position!=null">
- position_=#{position,jdbcType= VARCHAR },
- </if>
- <if test="inside!=null">
- inside_=#{inside,jdbcType= NUMERIC },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="CompanyInfoMap">
- select * from base_company_info where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_company_info where id_=#{0}
- </select>
- <select id="list" resultMap="CompanyInfoMap">
- select * from base_company_info where del_flag = 0 order by create_time asc
- </select>
- <select id="search" parameterType="hashmap" resultMap="CompanyInfoMap">
- <![CDATA[
- SELECT
- a.*,
- b.industry_name AS industry_name
- FROM
- base_company_info a
- LEFT JOIN base_industry_info b ON a.industry_ = b.id_
- ]]>
- <where>
- a.del_flag = 0
- and b.del_flag = 0
- <if test="searchParams.id != null">
- and a.ID_ like #{searchParams.id}
- </if>
- <if test="searchParams.companyName != null">
- and a.company_name like #{searchParams.companyName}
- </if>
- <if test="searchParams.region != null">
- and a.region_ = #{searchParams.region}
- </if>
- <if test="searchParams.type != null">
- and a.type_ = #{searchParams.type}
- </if>
- <if test="searchParams.scale != null">
- and a.scale_ = #{searchParams.scale}
- </if>
- <if test="searchParams.industry != null">
- and a.industry_ = #{searchParams.industry}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- <select id="findByName" parameterType="string" resultMap="CompanyInfoMap">
- select * from base_company_info a where company_name=#{0} and del_flag = 0
- </select>
- </mapper>
|