MeetPersSginListDao.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.MeetPersSginListDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.MeetPersSginList" id="meetPersSginListResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="meetId" column="MEET_ID"/>
  7. <result property="sginId" column="SGIN_ID"/>
  8. <result property="persId" column="PERS_ID"/>
  9. <result property="sginTm" column="SGIN_TM"/>
  10. <result property="sginType" column="SGIN_TYPE"/>
  11. <result property="gdX" column="GD_X"/>
  12. <result property="gdY" column="GD_Y"/>
  13. </resultMap>
  14. <resultMap id="MeetSginInOutInfoDtoResult" type="cn.com.goldenwater.dcproj.dto.MeetSginInOutInfoDto">
  15. <result property="id" column="ID"/>
  16. <result property="meetId" column="MEET_ID"/>
  17. <result property="type" column="TYPE"/>
  18. <result property="stTm" column="ST_TM" jdbcType="TIMESTAMP"/>
  19. <result property="enTm" column="EN_TM" jdbcType="TIMESTAMP"/>
  20. <result property="perSignId" column="PERSIGNID"/>
  21. </resultMap>
  22. <sql id="table_columns">
  23. ID,
  24. MEET_ID,
  25. SGIN_ID,
  26. PERS_ID,
  27. SGIN_TM,
  28. SGIN_TYPE,
  29. GD_X,
  30. GD_Y
  31. </sql>
  32. <sql id="entity_properties">
  33. #{id},
  34. #{meetId},
  35. #{sginId},
  36. #{persId},
  37. #{sginTm},
  38. #{sginType},
  39. #{gdX},
  40. #{gdY}
  41. </sql>
  42. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  43. <sql id="page_where">
  44. <trim prefix="where" prefixOverrides="and | or ">
  45. <if test="meetId != null and meetId != ''">and MEET_ID = #{meetId}</if>
  46. <if test="sginId != null and sginId != ''">and SGIN_ID = #{sginId}</if>
  47. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  48. <if test="sginTm != null">and SGIN_TM = #{sginTm}</if>
  49. <if test="sginType != null and sginType != ''">and SGIN_TYPE = #{sginType}</if>
  50. <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
  51. <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
  52. </trim>
  53. </sql>
  54. <select id="get" resultMap="meetPersSginListResultMap" parameterType="String">
  55. select
  56. <include refid="table_columns"/>
  57. from MEET_PERS_SGIN_LIST where ID = #{id}
  58. </select>
  59. <select id="getBy" resultMap="meetPersSginListResultMap">
  60. select
  61. <include refid="table_columns"/>
  62. from MEET_PERS_SGIN_LIST
  63. <include refid="page_where"/>
  64. </select>
  65. <select id="findAll" resultMap="meetPersSginListResultMap">
  66. select
  67. <include refid="table_columns"/>
  68. from MEET_PERS_SGIN_LIST
  69. </select>
  70. <select id="findList" resultMap="meetPersSginListResultMap">
  71. select
  72. <include refid="table_columns"/>
  73. from MEET_PERS_SGIN_LIST
  74. <include refid="page_where"/>
  75. </select>
  76. <select id="selectCount" resultType="int">
  77. select count(ID) from MEET_PERS_SGIN_LIST
  78. <include refid="page_where"/>
  79. </select>
  80. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.MeetPersSginList">
  81. insert into MEET_PERS_SGIN_LIST(
  82. <include refid="table_columns"/>
  83. )
  84. values (
  85. <include refid="entity_properties"/>
  86. )
  87. </insert>
  88. <delete id="delete" parameterType="java.lang.String">
  89. delete from MEET_PERS_SGIN_LIST where ID = #{id}
  90. </delete>
  91. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.MeetPersSginList">
  92. delete from MEET_PERS_SGIN_LIST
  93. <include refid="page_where"/>
  94. </delete>
  95. <update id="deleteInFlag" parameterType="java.lang.String">
  96. update MEET_PERS_SGIN_LIST set flag_valid = 0 where ID = #{id}
  97. </update>
  98. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.MeetPersSginList">
  99. update MEET_PERS_SGIN_LIST
  100. <trim prefix="set" suffixOverrides=",">
  101. <if test="meetId != null and meetId != ''">MEET_ID = #{meetId},</if>
  102. <if test="sginId != null and sginId != ''">SGIN_ID = #{sginId},</if>
  103. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  104. <if test="sginTm != null">SGIN_TM = #{sginTm},</if>
  105. <if test="sginType != null and sginType != ''">SGIN_TYPE = #{sginType},</if>
  106. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  107. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  108. </trim>
  109. <where>ID = #{id}</where>
  110. </update>
  111. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.MeetPersSginList">
  112. update MEET_PERS_SGIN_LIST
  113. <trim prefix="set" suffixOverrides=",">
  114. <if test="meetId != null and meetId != ''">MEET_ID = #{meetId},</if>
  115. <if test="sginId != null and sginId != ''">SGIN_ID = #{sginId},</if>
  116. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  117. <if test="sginTm != null">SGIN_TM = #{sginTm},</if>
  118. <if test="sginType != null and sginType != ''">SGIN_TYPE = #{sginType},</if>
  119. <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
  120. <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
  121. </trim>
  122. <include refid="page_where"/>
  123. </update>
  124. <!-- 其他自定义SQL -->
  125. <select id="findMeetPersSginList" parameterType="cn.com.goldenwater.dcproj.param.MeetPersSginListParam"
  126. resultType="cn.com.goldenwater.dcproj.model.MeetPersSginList">
  127. select
  128. <include refid="table_columns"/>
  129. from MEET_PERS_SGIN_LIST t
  130. <include refid="page_where"/>
  131. order by t.SGIN_TM
  132. </select>
  133. <select id="getSignState" parameterType="cn.com.goldenwater.dcproj.param.MeetPersSginListParam"
  134. resultMap="MeetSginInOutInfoDtoResult">
  135. select t.*,l.id as perSignId from MEET_SGIN_IN_OUT_INFO t left join MEET_PERS_SGIN_LIST l on t.id = l.sgin_id
  136. and l.pers_id = #{persId} where t.meet_id = #{meetId} and t.st_tm &lt;= SYSDATE() and t.en_tm &gt;= SYSDATE()
  137. order by t.st_tm
  138. </select>
  139. <select id="getMeetPersSignPage" parameterType="cn.com.goldenwater.dcproj.param.MeetPersSginListParam"
  140. resultType="cn.com.goldenwater.dcproj.dto.MeetPersSginListDto">
  141. select t.*,p.name,p.mble_num as mbleNum,p.unit from MEET_PERS_SGIN_LIST t left join MEET_PERS_LIST p on
  142. t.pers_id = p.id
  143. <include refid="page_where"/>
  144. </select>
  145. </mapper>