| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?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.employment.modules.base.dao.ConstructionProgressDAO">
- <resultMap id="ConstructionProgressMap" type="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
- <id property="id" column="id_" />
- <result property="title" column="title_" />
- <result property="image" column="image_" />
- <result property="submitBy" column="submit_by" />
- <result property="submitType" column="submit_type" />
- <result property="submitTime" column="submit_time" />
- <result property="workOrderId" column="work_order_id" />
- <result property="index" column="index_" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="updateBy" column="update_by" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_construction_progress
- (id_,title_,image_,submit_by,submit_type,submit_time,work_order_id,index_,create_time,update_time,del_flag,create_by,update_by)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{title,jdbcType=VARCHAR}
- ,#{image,jdbcType=VARCHAR}
- ,#{submitBy,jdbcType=VARCHAR}
- ,#{submitType,jdbcType=VARCHAR}
- ,#{submitTime,jdbcType= TIMESTAMP }
- ,#{workOrderId,jdbcType=VARCHAR}
- ,#{index,jdbcType= NUMERIC }
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{createBy,jdbcType=VARCHAR}
- ,#{updateBy,jdbcType=VARCHAR}
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_construction_progress where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
- update base_construction_progress
- <set>
- <if test="title!=null">
- title_=#{title,jdbcType=VARCHAR},
- </if>
- <if test="image!=null">
- image_=#{image,jdbcType=VARCHAR},
- </if>
- <if test="submitBy!=null">
- submit_by=#{submitBy,jdbcType=VARCHAR},
- </if>
- <if test="submitType!=null">
- submit_type=#{submitType,jdbcType=VARCHAR},
- </if>
- <if test="submitTime!=null">
- submit_time=#{submitTime,jdbcType= TIMESTAMP },
- </if>
- <if test="workOrderId!=null">
- work_order_id=#{workOrderId,jdbcType=VARCHAR},
- </if>
- <if test="index!=null">
- index_=#{index,jdbcType= NUMERIC },
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="ConstructionProgressMap">
- select
- id_,title_,image_,submit_by,submit_type,submit_time,work_order_id,index_,create_time,update_time,del_flag,create_by,update_by from base_construction_progress where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_construction_progress where id_=#{0}
- </select>
- <select id="list" resultMap="ConstructionProgressMap">
- select * from base_construction_progress
- </select>
- <select id="findByWorkOrderId" resultMap="ConstructionProgressMap">
- select * from base_construction_progress where del_flag=false and work_order_id=#{0}
- </select>
- <select id="search" parameterType="hashmap" resultMap="ConstructionProgressMap">
- <![CDATA[
- select * from base_construction_progress
- ]]>
- <where>
- <if test="searchParams.id != null">
- and ID_ like #{searchParams.id}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- <select id="getIndex" resultType="integer">
- select index_ from base_construction_progress
- where del_flag=false
- and work_order_id=#{0}
- order by index_ desc
- limit 1
- </select>
- </mapper>
|