| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473 |
- <?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.goafanti.common.dao.ScDemandMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.ScDemand">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="industry" jdbcType="INTEGER" property="industry" />
- <result column="summary" jdbcType="VARCHAR" property="summary" />
- <result column="introduce" jdbcType="VARCHAR" property="introduce" />
- <result column="publisher_id" jdbcType="VARCHAR" property="publisherId" />
- <result column="reserve_butt_mode" jdbcType="INTEGER" property="reserveButtMode" />
- <result column="reserve_butt_unit" jdbcType="VARCHAR" property="reserveButtUnit" />
- <result column="reserve_solve_mode" jdbcType="INTEGER" property="reserveSolveMode" />
- <result column="investment_cost" jdbcType="VARCHAR" property="investmentCost" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- id, name, type, industry, summary, introduce, publisher_id, reserve_butt_mode, reserve_butt_unit,
- reserve_solve_mode, investment_cost, create_time, delete_sign
- </sql>
- <select id="selectByExample" parameterType="com.goafanti.common.model.ScDemandExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from sc_demand
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- select
- <include refid="Base_Column_List" />
- from sc_demand
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- delete from sc_demand
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.ScDemandExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- delete from sc_demand
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.ScDemand">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- insert into sc_demand (id, name, type,
- industry, summary, introduce,
- publisher_id, reserve_butt_mode, reserve_butt_unit,
- reserve_solve_mode, investment_cost, create_time,
- delete_sign)
- values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
- #{industry,jdbcType=INTEGER}, #{summary,jdbcType=VARCHAR}, #{introduce,jdbcType=VARCHAR},
- #{publisherId,jdbcType=VARCHAR}, #{reserveButtMode,jdbcType=INTEGER}, #{reserveButtUnit,jdbcType=VARCHAR},
- #{reserveSolveMode,jdbcType=INTEGER}, #{investmentCost,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{deleteSign,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.ScDemand">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- insert into sc_demand
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="name != null">
- name,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="industry != null">
- industry,
- </if>
- <if test="summary != null">
- summary,
- </if>
- <if test="introduce != null">
- introduce,
- </if>
- <if test="publisherId != null">
- publisher_id,
- </if>
- <if test="reserveButtMode != null">
- reserve_butt_mode,
- </if>
- <if test="reserveButtUnit != null">
- reserve_butt_unit,
- </if>
- <if test="reserveSolveMode != null">
- reserve_solve_mode,
- </if>
- <if test="investmentCost != null">
- investment_cost,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="deleteSign != null">
- delete_sign,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="industry != null">
- #{industry,jdbcType=INTEGER},
- </if>
- <if test="summary != null">
- #{summary,jdbcType=VARCHAR},
- </if>
- <if test="introduce != null">
- #{introduce,jdbcType=VARCHAR},
- </if>
- <if test="publisherId != null">
- #{publisherId,jdbcType=VARCHAR},
- </if>
- <if test="reserveButtMode != null">
- #{reserveButtMode,jdbcType=INTEGER},
- </if>
- <if test="reserveButtUnit != null">
- #{reserveButtUnit,jdbcType=VARCHAR},
- </if>
- <if test="reserveSolveMode != null">
- #{reserveSolveMode,jdbcType=INTEGER},
- </if>
- <if test="investmentCost != null">
- #{investmentCost,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deleteSign != null">
- #{deleteSign,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.ScDemandExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- select count(*) from sc_demand
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- update sc_demand
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.name != null">
- name = #{record.name,jdbcType=VARCHAR},
- </if>
- <if test="record.type != null">
- type = #{record.type,jdbcType=INTEGER},
- </if>
- <if test="record.industry != null">
- industry = #{record.industry,jdbcType=INTEGER},
- </if>
- <if test="record.summary != null">
- summary = #{record.summary,jdbcType=VARCHAR},
- </if>
- <if test="record.introduce != null">
- introduce = #{record.introduce,jdbcType=VARCHAR},
- </if>
- <if test="record.publisherId != null">
- publisher_id = #{record.publisherId,jdbcType=VARCHAR},
- </if>
- <if test="record.reserveButtMode != null">
- reserve_butt_mode = #{record.reserveButtMode,jdbcType=INTEGER},
- </if>
- <if test="record.reserveButtUnit != null">
- reserve_butt_unit = #{record.reserveButtUnit,jdbcType=VARCHAR},
- </if>
- <if test="record.reserveSolveMode != null">
- reserve_solve_mode = #{record.reserveSolveMode,jdbcType=INTEGER},
- </if>
- <if test="record.investmentCost != null">
- investment_cost = #{record.investmentCost,jdbcType=VARCHAR},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.deleteSign != null">
- delete_sign = #{record.deleteSign,jdbcType=INTEGER},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- update sc_demand
- set id = #{record.id,jdbcType=VARCHAR},
- name = #{record.name,jdbcType=VARCHAR},
- type = #{record.type,jdbcType=INTEGER},
- industry = #{record.industry,jdbcType=INTEGER},
- summary = #{record.summary,jdbcType=VARCHAR},
- introduce = #{record.introduce,jdbcType=VARCHAR},
- publisher_id = #{record.publisherId,jdbcType=VARCHAR},
- reserve_butt_mode = #{record.reserveButtMode,jdbcType=INTEGER},
- reserve_butt_unit = #{record.reserveButtUnit,jdbcType=VARCHAR},
- reserve_solve_mode = #{record.reserveSolveMode,jdbcType=INTEGER},
- investment_cost = #{record.investmentCost,jdbcType=VARCHAR},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- delete_sign = #{record.deleteSign,jdbcType=INTEGER}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ScDemand">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- update sc_demand
- <set>
- <if test="name != null">
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="industry != null">
- industry = #{industry,jdbcType=INTEGER},
- </if>
- <if test="summary != null">
- summary = #{summary,jdbcType=VARCHAR},
- </if>
- <if test="introduce != null">
- introduce = #{introduce,jdbcType=VARCHAR},
- </if>
- <if test="publisherId != null">
- publisher_id = #{publisherId,jdbcType=VARCHAR},
- </if>
- <if test="reserveButtMode != null">
- reserve_butt_mode = #{reserveButtMode,jdbcType=INTEGER},
- </if>
- <if test="reserveButtUnit != null">
- reserve_butt_unit = #{reserveButtUnit,jdbcType=VARCHAR},
- </if>
- <if test="reserveSolveMode != null">
- reserve_solve_mode = #{reserveSolveMode,jdbcType=INTEGER},
- </if>
- <if test="investmentCost != null">
- investment_cost = #{investmentCost,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deleteSign != null">
- delete_sign = #{deleteSign,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ScDemand">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Tue Jun 26 18:28:31 CST 2018.
- -->
- update sc_demand
- set name = #{name,jdbcType=VARCHAR},
- type = #{type,jdbcType=INTEGER},
- industry = #{industry,jdbcType=INTEGER},
- summary = #{summary,jdbcType=VARCHAR},
- introduce = #{introduce,jdbcType=VARCHAR},
- publisher_id = #{publisherId,jdbcType=VARCHAR},
- reserve_butt_mode = #{reserveButtMode,jdbcType=INTEGER},
- reserve_butt_unit = #{reserveButtUnit,jdbcType=VARCHAR},
- reserve_solve_mode = #{reserveSolveMode,jdbcType=INTEGER},
- investment_cost = #{investmentCost,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- delete_sign = #{deleteSign,jdbcType=INTEGER}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.sc.bo.ScDemandListBo">
- select a.id,a.name,a.industry,b.name as orgName,a.reserve_butt_unit as reserveButtUnit,
- b.contacts,b.telephone,b.address
- from sc_demand a left join sc_publisher b on a.publisher_id=b.id
- left join sc_organization c on b.id=c.publisher_id
- left join industry_category d on a.industry=d.id
- where a.delete_sign=0
- <if test="type != null">
- and a.`type`= #{type,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orgName != null">
- and b.name like CONCAT('%',#{orgName,jdbcType=VARCHAR},'%')
- </if>
- <if test="reserveButtUnit != null">
- and a.reserve_butt_unit like CONCAT('%',#{reserveButtUnit,jdbcType=VARCHAR},'%')
- </if>
- order by a.create_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
- select count(*)
- from sc_demand a left join sc_publisher b on a.publisher_id=b.id
- where a.delete_sign=0
- <if test="type != null">
- and a.`type`= #{type,jdbcType=VARCHAR}
- </if>
- <if test="name != null">
- and a.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
- </if>
- <if test="orgName != null">
- and b.name like CONCAT('%',#{orgName,jdbcType=VARCHAR},'%')
- </if>
- <if test="reserveButtUnit != null">
- and a.reserve_butt_unit = #{reserveButtUnit,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectById" parameterType="String" resultType="com.goafanti.sc.bo.inputDemands">
- select a.id,a.name,a.type,a.introduce,a.summary,a.industry,
- a.reserve_butt_mode as reserveButtMode,a.reserve_butt_unit as reserveButtUnit,a.reserve_solve_mode as reserveSolveMode,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createDateFormat,a.investment_cost as investmentCost,
- b.name as pname,b.province,d.name as provinceName,b.city,e.name as cityName,b.email, b.zip_code as zipCode,
- b.contacts as publisherName, b.telephone, b.address, b.introduce as Pintroduce, b.remarks,
- f.nature,f.website,f.feature,f.legal_person as legalPerson,
- f.employee_number as employeeNumber,f.registered_capital as registeredCapital,
- f.licence_number as licenceNumber
- from sc_demand a left join sc_publisher b on a.publisher_id=b.id
- left join industry_category c on a.industry=c.id
- left join district_glossory d on b.province=d.id
- left join district_glossory e on b.province=e.id
- left join sc_organization f on a.publisher_id=f.publisher_id
- where a.id= #{id,jdbcType=VARCHAR}
- </select>
- </mapper>
|