123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?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">
- <!--
- 这个文件是自动生成的。
- 不要修改此文件。所有改动将在下次重新自动生成时丢失。
- -->
- <mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupPerformanceDao">
-
- <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPerformance" id="MusicGroupPerformance">
- <result column="id_" property="id" />
- <result column="music_group_id_" property="musicGroupId" />
- <result column="name_" property="name" />
- <result column="music_score_name_" property="musicScoreName" />
- <result column="operator_" property="operator" />
- <result column="operator_name_" property="operatorName" />
- <result column="order_" property="order" />
- <result column="start_time_" property="startTime" />
- <result column="sub_day_" property="subDay" />
- <result column="music_group_name_" property="musicGroupName" />
- <result column="organ_name_" property="organName" />
- <result column="create_time_" property="createTime" />
- <result column="update_time_" property="updateTime" />
- </resultMap>
-
- <!-- 根据主键查询一条记录 -->
- <select id="get" resultMap="MusicGroupPerformance" >
- SELECT * FROM music_group_performance WHERE id_ = #{id}
- </select>
-
- <!-- 全查询 -->
- <select id="findAll" resultMap="MusicGroupPerformance">
- SELECT * FROM music_group_performance ORDER BY id_
- </select>
-
- <!-- 向数据库增加一条记录 -->
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPerformance" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- INSERT INTO music_group_performance (music_group_id_,name_,music_score_name_,operator_,order_,start_time_,create_time_,update_time_)
- VALUES(#{musicGroupId},#{name},#{musicScoreName},#{operator},#{order},#{startTime},NOW(),NOW())
- </insert>
-
- <!-- 根据主键查询一条记录 -->
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPerformance">
- UPDATE music_group_performance <set>
- <if test="operator != null">
- operator_ = #{operator},
- </if>
- <if test="musicScoreName != null">
- music_score_name_ = #{musicScoreName},
- </if>
- <if test="musicGroupId != null">
- music_group_id_ = #{musicGroupId},
- </if>
- <if test="order != null">
- order_ = #{order},
- </if>
- <if test="name != null">
- name_ = #{name},
- </if>
- <if test="startTime != null">
- start_time_ = #{startTime},
- </if>
- update_time_ = NOW()
- </set> WHERE id_ = #{id}
- </update>
-
- <!-- 根据主键删除一条记录 -->
- <delete id="delete" >
- DELETE FROM music_group_performance WHERE id_ = #{id}
- </delete>
-
- <!-- 分页查询 -->
- <select id="queryPage" resultMap="MusicGroupPerformance" parameterType="map">
- SELECT mgp.*,su.real_name_ operator_name_ FROM music_group_performance mgp
- LEFT JOIN sys_user su ON su.id_ = mgp.operator_
- <where>
- <if test="musicGroupId != null and musicGroupId != ''">
- AND mgp.music_group_id_ = #{musicGroupId}
- </if>
- </where>
- ORDER BY mgp.order_ ASC,mgp.start_time_ ASC
- <include refid="global.limit"/>
- </select>
-
- <!-- 查询当前表的总记录数 -->
- <select id="queryCount" resultType="int">
- SELECT COUNT(mgp.id_) FROM music_group_performance mgp
- <where>
- <if test="musicGroupId != null and musicGroupId != ''">
- AND mgp.music_group_id_ = #{musicGroupId}
- </if>
- </where>
- </select>
- <select id="findNoStart" resultMap="MusicGroupPerformance">
- SELECT mgp.* FROM music_group_performance mgp
- LEFT JOIN music_group mg ON mg.id_ = mgp.music_group_id_
- WHERE DATEDIFF(DATE_FORMAT(start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0
- <if test="educationUserId != null">
- AND mg.educational_teacher_id_ = #{educationUserId}
- </if>
- <if test="organIds != null and organIds != ''">
- AND FIND_IN_SET(mg.organ_id_,#{organIds})
- </if>
- </select>
- <select id="queryNoStart" resultMap="MusicGroupPerformance">
- SELECT mgp.*,mg.name_ music_group_name_,o.name_ organ_name_,DATEDIFF(DATE_FORMAT(mgp.start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) sub_day_
- FROM music_group_performance mgp
- LEFT JOIN music_group mg ON mg.id_ = mgp.music_group_id_
- LEFT JOIN organization o ON o.id_ = mg.organ_id_
- WHERE DATEDIFF(DATE_FORMAT(mgp.start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0
- <if test="educationUserId != null">
- AND mg.educational_teacher_id_ = #{educationUserId}
- </if>
- <if test="search != null and search != ''">
- AND (mg.id_ = #{search} OR mg.name_ LIKE CONCAT('%',#{search},'%'))
- </if>
- <if test="organId != null and organId != ''">
- AND FIND_IN_SET(mg.organ_id_,#{organId})
- </if>
- <include refid="global.limit"/>
- </select>
- <select id="countNoStart" resultType="java.lang.Integer">
- SELECT COUNT(mgp.id_) FROM music_group_performance mgp
- LEFT JOIN music_group mg ON mg.id_ = mgp.music_group_id_
- WHERE DATEDIFF(DATE_FORMAT(start_time_, '%Y-%m-%d'),DATE_FORMAT(NOW(), '%Y-%m-%d')) >= 0
- <if test="educationUserId != null">
- AND mg.educational_teacher_id_ = #{educationUserId}
- </if>
- <if test="search != null and search != ''">
- AND (mg.id_ = #{search} OR mg.name_ LIKE CONCAT('%',#{search},'%'))
- </if>
- <if test="organId != null and organId != ''">
- AND FIND_IN_SET(mg.organ_id_,#{organId})
- </if>
- </select>
- </mapper>
|