LedgerDormFireSafetyMapper.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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="com.sundot.airport.ledger.mapper.LedgerDormFireSafetyMapper">
  4. <resultMap id="BaseResultMap" type="com.sundot.airport.ledger.domain.LedgerDormFireSafety">
  5. <id property="id" column="id" />
  6. <result property="checkDate" column="check_date" />
  7. <result property="dormLocation" column="dorm_location" />
  8. <result property="dormNo" column="dorm_no" />
  9. <result property="checkItems" column="check_items" />
  10. <result property="riskStatus" column="risk_status" />
  11. <result property="foundRisk" column="found_risk" />
  12. <result property="photos" column="photos" />
  13. <result property="rectifyPerson" column="rectify_person" />
  14. <result property="rectifyTime" column="rectify_time" />
  15. <result property="submitTime" column="submit_time" />
  16. <result property="submitter" column="submitter" />
  17. <result property="importBatch" column="import_batch" />
  18. <result property="sourceType" column="source_type" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="syncFlag" column="sync_flag" />
  24. </resultMap>
  25. <sql id="selectVo">
  26. SELECT id, check_date, dorm_location, dorm_no, check_items, risk_status, found_risk,
  27. photos, rectify_person, rectify_time, submit_time, submitter,
  28. import_batch, source_type, create_by, create_time, update_by, update_time, sync_flag
  29. FROM ledger_dorm_fire_safety
  30. WHERE del_flag = '0'
  31. </sql>
  32. <select id="selectList" parameterType="com.sundot.airport.ledger.domain.LedgerDormFireSafety" resultMap="BaseResultMap">
  33. <include refid="selectVo"/>
  34. <if test="dormLocation != null and dormLocation != ''">AND dorm_location LIKE CONCAT('%', #{dormLocation}, '%')</if>
  35. <if test="submitter != null and submitter != ''">AND submitter LIKE CONCAT('%', #{submitter}, '%')</if>
  36. <if test="dormNo != null and dormNo != ''">AND dorm_no LIKE CONCAT('%', #{dormNo}, '%')</if>
  37. <if test="syncFlag != null and syncFlag != ''">AND sync_flag = #{syncFlag}</if>
  38. <if test="params != null and params.beginTime != null and params.beginTime != ''">
  39. AND check_date &gt;= #{params.beginTime}
  40. </if>
  41. <if test="params != null and params.endTime != null and params.endTime != ''">
  42. AND check_date &lt;= #{params.endTime}
  43. </if>
  44. ORDER BY id DESC
  45. </select>
  46. <update id="updateSyncFlag">
  47. update ledger_dorm_fire_safety
  48. set sync_flag = '1'
  49. where sync_flag = '0'
  50. </update>
  51. </mapper>