YdysyxzMapper.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.siwei.apply.mapper.YdysyxzMapper">
  6. <resultMap id="resMap" type="com.siwei.apply.domain.Ydysyxz">
  7. <id property="id" column="id"/>
  8. <result property="projectId" column="project_id"/>
  9. <result property="jsyj" column="jsyj"/>
  10. <result property="jsdd" column="jsdd"/>
  11. <result property="area" column="area"/>
  12. <result property="areaUnit" column="area_unit"/>
  13. <result property="hasZz" column="has_zz"/>
  14. <result property="xmjsyj" column="xmjsyj"/>
  15. <result property="zzwh" column="zzwh"/>
  16. <result property="fzDate" column="fz_date"/>
  17. <result property="attachment" column="attachment" typeHandler="com.siwei.apply.handler.JsonbTypeHandler"/>
  18. <result property="hasOnchain" column="has_onchain"/>
  19. <result property="createdAt" column="created_at"/>
  20. <result property="updatedAt" column="updated_at"/>
  21. <result property="creatorId" column="creator_id"/>
  22. </resultMap>
  23. <select id="isExit" resultType="Boolean">
  24. SELECT COUNT(1) > 0
  25. FROM t_ydysyxz
  26. WHERE project_id = #{projectId}
  27. </select>
  28. <insert id="add" parameterType="com.siwei.apply.domain.Ydysyxz">
  29. INSERT INTO t_ydysyxz (id, project_id, jsyj, jsdd, area, area_unit, has_zz,
  30. xmjsyj, zzwh, fz_date, has_onchain, created_at, updated_at, creator_id)
  31. VALUES (#{id}, #{projectId}, #{jsyj}, #{jsdd}, #{area}, #{areaUnit}, #{hasZz},
  32. #{xmjsyj}, #{zzwh}, #{fzDate},
  33. false, now(), now(), #{creatorId})
  34. </insert>
  35. <select id="get" resultMap="resMap">
  36. SELECT *
  37. FROM t_ydysyxz
  38. WHERE project_id = #{projectId}
  39. </select>
  40. <update id="update" parameterType="com.siwei.apply.domain.vo.YdysyxzUpdateVo">
  41. UPDATE t_ydysyxz
  42. <set>
  43. <if test="jsyj != null">jsyj = #{jsyj},</if>
  44. <if test="projectId != null">project_id = #{projectId},</if>
  45. <if test="jsdd != null">jsdd = #{jsdd},</if>
  46. <if test="area != null">area = #{area},</if>
  47. <if test="areaUnit != null">area_unit = #{areaUnit},</if>
  48. <if test="hasZz != null">has_zz = #{hasZz},</if>
  49. <if test="xmjsyj != null">xmjsyj = #{xmjsyj},</if>
  50. <if test="zzwh != null">zzwh = #{zzwh},</if>
  51. <if test="fzDate != null">fz_date = #{fzDate},</if>
  52. <if test="hasOnchain != null">has_onchain = #{hasOnchain},</if>
  53. updated_at = now()
  54. </set>
  55. WHERE id = #{id}
  56. </update>
  57. </mapper>