TBusDailyMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.business.slfh.manager.dailymanager.mapper.TBusDailyMapper">
  6. <resultMap type="TBusDaily" id="TBusDailyResult">
  7. <result property="id" column="id" />
  8. <result property="status" column="status" />
  9. <result property="remark" column="remark" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="dailyType" column="daily_type" />
  16. <result property="userId" column="user_id" />
  17. <result property="userName" column="user_name" />
  18. <result property="dailyTime" column="daily_time" />
  19. <result property="title" column="title" />
  20. <result property="content" column="content" />
  21. <result property="ishaveRes" column="ishave_res" />
  22. <result property="ishaveReply" column="ishave_reply" />
  23. <result property="replyContent" column="reply_content" />
  24. <result property="replyUser" column="reply_user" />
  25. <result property="replyTime" column="reply_time" />
  26. </resultMap>
  27. <sql id="selectTBusDailyVo">
  28. select id, status, remark, del_flag, create_by, create_time, update_by, update_time, daily_type, user_id, user_name, daily_time, title, content, ishave_res, ishave_reply, reply_content, reply_user, reply_time from t_bus_daily
  29. </sql>
  30. <select id="selectTBusDailyList" parameterType="TBusDaily" resultMap="TBusDailyResult">
  31. <include refid="selectTBusDailyVo"/>
  32. <where>
  33. <if test="status != null and status != ''"> and status = #{status}</if>
  34. <if test="dailyType != null and dailyType != ''"> and daily_type = #{dailyType}</if>
  35. <if test="userId != null "> and user_id = #{userId}</if>
  36. <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
  37. <if test="params.beginDailyTime != null and params.beginDailyTime != ''"><!-- 开始时间检索 -->
  38. AND date_format(daily_time,'%y%m%d') &gt;= date_format(#{params.beginDailyTime},'%y%m%d')
  39. </if>
  40. <if test="params.endDailyTime != null and params.endDailyTime != ''"><!-- 结束时间检索 -->
  41. AND date_format(daily_time,'%y%m%d') &lt;= date_format(#{params.endDailyTime},'%y%m%d')
  42. </if>
  43. <!--<if test="dailyTime != null "> and daily_time = #{dailyTime}</if>-->
  44. <if test="title != null and title != ''"> and title = #{title}</if>
  45. <if test="content != null and content != ''"> and content = #{content}</if>
  46. <if test="ishaveRes != null "> and ishave_res = #{ishaveRes}</if>
  47. <if test="ishaveReply != null "> and ishave_reply = #{ishaveReply}</if>
  48. <if test="replyContent != null and replyContent != ''"> and reply_content = #{replyContent}</if>
  49. <if test="replyUser != null and replyUser != ''"> and reply_user = #{replyUser}</if>
  50. <if test="replyTime != null "> and reply_time = #{replyTime}</if>
  51. </where>
  52. </select>
  53. <select id="selectTBusDailyById" parameterType="String" resultMap="TBusDailyResult">
  54. <include refid="selectTBusDailyVo"/>
  55. where id = #{id}
  56. </select>
  57. <insert id="insertTBusDaily" parameterType="TBusDaily">
  58. insert into t_bus_daily
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="id != null and id != ''">id,</if>
  61. <if test="status != null">status,</if>
  62. <if test="remark != null">remark,</if>
  63. <if test="delFlag != null">del_flag,</if>
  64. <if test="createBy != null">create_by,</if>
  65. <if test="createTime != null">create_time,</if>
  66. <if test="updateBy != null">update_by,</if>
  67. <if test="updateTime != null">update_time,</if>
  68. <if test="dailyType != null">daily_type,</if>
  69. <if test="userId != null">user_id,</if>
  70. <if test="userName != null">user_name,</if>
  71. <if test="dailyTime != null">daily_time,</if>
  72. <if test="title != null">title,</if>
  73. <if test="content != null">content,</if>
  74. <if test="ishaveRes != null">ishave_res,</if>
  75. <if test="ishaveReply != null">ishave_reply,</if>
  76. <if test="replyContent != null">reply_content,</if>
  77. <if test="replyUser != null">reply_user,</if>
  78. <if test="replyTime != null">reply_time,</if>
  79. </trim>
  80. <trim prefix="values (" suffix=")" suffixOverrides=",">
  81. <if test="id != null and id != ''">#{id},</if>
  82. <if test="status != null">#{status},</if>
  83. <if test="remark != null">#{remark},</if>
  84. <if test="delFlag != null">#{delFlag},</if>
  85. <if test="createBy != null">#{createBy},</if>
  86. <if test="createTime != null">#{createTime},</if>
  87. <if test="updateBy != null">#{updateBy},</if>
  88. <if test="updateTime != null">#{updateTime},</if>
  89. <if test="dailyType != null">#{dailyType},</if>
  90. <if test="userId != null">#{userId},</if>
  91. <if test="userName != null">#{userName},</if>
  92. <if test="dailyTime != null">#{dailyTime},</if>
  93. <if test="title != null">#{title},</if>
  94. <if test="content != null">#{content},</if>
  95. <if test="ishaveRes != null">#{ishaveRes},</if>
  96. <if test="ishaveReply != null">#{ishaveReply},</if>
  97. <if test="replyContent != null">#{replyContent},</if>
  98. <if test="replyUser != null">#{replyUser},</if>
  99. <if test="replyTime != null">#{replyTime},</if>
  100. </trim>
  101. </insert>
  102. <update id="updateTBusDaily" parameterType="TBusDaily">
  103. update t_bus_daily
  104. <trim prefix="SET" suffixOverrides=",">
  105. <if test="status != null">status = #{status},</if>
  106. <if test="remark != null">remark = #{remark},</if>
  107. <if test="delFlag != null">del_flag = #{delFlag},</if>
  108. <if test="createBy != null">create_by = #{createBy},</if>
  109. <if test="createTime != null">create_time = #{createTime},</if>
  110. <if test="updateBy != null">update_by = #{updateBy},</if>
  111. <if test="updateTime != null">update_time = #{updateTime},</if>
  112. <if test="dailyType != null">daily_type = #{dailyType},</if>
  113. <if test="userId != null">user_id = #{userId},</if>
  114. <if test="userName != null">user_name = #{userName},</if>
  115. <if test="dailyTime != null">daily_time = #{dailyTime},</if>
  116. <if test="title != null">title = #{title},</if>
  117. <if test="content != null">content = #{content},</if>
  118. <if test="ishaveRes != null">ishave_res = #{ishaveRes},</if>
  119. <if test="ishaveReply != null">ishave_reply = #{ishaveReply},</if>
  120. <if test="replyContent != null">reply_content = #{replyContent},</if>
  121. <if test="replyUser != null">reply_user = #{replyUser},</if>
  122. <if test="replyTime != null">reply_time = #{replyTime},</if>
  123. </trim>
  124. where id = #{id}
  125. </update>
  126. <delete id="deleteTBusDailyById" parameterType="String">
  127. delete from t_bus_daily where id = #{id}
  128. </delete>
  129. <delete id="deleteTBusDailyByIds" parameterType="String">
  130. delete from t_bus_daily where id in
  131. <foreach item="id" collection="array" open="(" separator="," close=")">
  132. #{id}
  133. </foreach>
  134. </delete>
  135. </mapper>