| | |
| | | <mapper namespace="com.ruoyi.app.application.mapper.ArdAppApplicationMapper"> |
| | | |
| | | <resultMap type="ArdAppApplication" id="ArdAppApplicationResult"> |
| | | <result property="applicationId" column="application_id" /> |
| | | <result property="commanderId" column="commander_id" /> |
| | | <result property="soilderId" column="soilder_id" /> |
| | | <result property="reason" column="reason" /> |
| | | <result property="applicationType" column="application_type" /> |
| | | <result property="begin" column="begin" /> |
| | | <result property="state" column="state" /> |
| | | <result property="soilderCheck" column="soilder_check" /> |
| | | <result property="applicationId" column="application_id" /> |
| | | <result property="commanderId" column="commander_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdAppApplicationVo"> |
| | | select application_id, commander_id, soilder_id, reason, application_type, begin, state from ard_app_application |
| | | select soilder_id, reason, application_type, begin, state, soilder_check, application_id, commander_id from ard_app_application |
| | | </sql> |
| | | |
| | | <select id="selectArdAppApplicationList" parameterType="ArdAppApplication" resultMap="ArdAppApplicationResult"> |
| | | <include refid="selectArdAppApplicationVo"/> |
| | | <where> |
| | | <if test="applicationId != null and applicationId != ''"> and application_id = #{applicationId}</if> |
| | | <if test="commanderId != null and commanderId != ''"> and commander_id = #{commanderId}</if> |
| | | <if test="soilderId != null and soilderId != ''"> and soilder_id = #{soilderId}</if> |
| | | <if test="reason != null and reason != ''"> and reason = #{reason}</if> |
| | | <if test="applicationType != null and applicationType != ''"> and application_type = #{applicationType}</if> |
| | | <if test="begin != null and begin != ''"> and begin = #{begin}</if> |
| | | <if test="state != null and state != ''"> and state = #{state}</if> |
| | | <if test="soilderCheck != null and soilderCheck != ''"> and soilder_check = #{soilderCheck}</if> |
| | | <if test="applicationId != null and applicationId != ''"> and application_id = #{applicationId}</if> |
| | | <if test="commanderId != null and commanderId != ''"> and commander_id = #{commanderId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdAppApplicationByApplicationId" parameterType="String" resultMap="ArdAppApplicationResult"> |
| | | <select id="selectArdAppApplicationBySoilderId" parameterType="String" resultMap="ArdAppApplicationResult"> |
| | | <include refid="selectArdAppApplicationVo"/> |
| | | where application_id = #{applicationId} |
| | | where soilder_id = #{soilderId} |
| | | </select> |
| | | |
| | | <insert id="insertArdAppApplication" parameterType="ArdAppApplication"> |
| | | insert into ard_app_application |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="applicationId != null">application_id,</if> |
| | | <if test="commanderId != null">commander_id,</if> |
| | | <if test="soilderId != null">soilder_id,</if> |
| | | <if test="reason != null">reason,</if> |
| | | <if test="applicationType != null">application_type,</if> |
| | | <if test="begin != null">begin,</if> |
| | | <if test="state != null">state,</if> |
| | | <if test="soilderCheck != null">soilder_check,</if> |
| | | <if test="applicationId != null">application_id,</if> |
| | | <if test="commanderId != null">commander_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="applicationId != null">#{applicationId},</if> |
| | | <if test="commanderId != null">#{commanderId},</if> |
| | | <if test="soilderId != null">#{soilderId},</if> |
| | | <if test="reason != null">#{reason},</if> |
| | | <if test="applicationType != null">#{applicationType},</if> |
| | | <if test="begin != null">#{begin},</if> |
| | | <if test="state != null">#{state},</if> |
| | | <if test="soilderCheck != null">#{soilderCheck},</if> |
| | | <if test="applicationId != null">#{applicationId},</if> |
| | | <if test="commanderId != null">#{commanderId},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdAppApplication" parameterType="ArdAppApplication"> |
| | | update ard_app_application |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="commanderId != null">commander_id = #{commanderId},</if> |
| | | <if test="soilderId != null">soilder_id = #{soilderId},</if> |
| | | <if test="reason != null">reason = #{reason},</if> |
| | | <if test="applicationType != null">application_type = #{applicationType},</if> |
| | | <if test="begin != null">begin = #{begin},</if> |
| | | <if test="state != null">state = #{state},</if> |
| | | <if test="soilderCheck != null">soilder_check = #{soilderCheck},</if> |
| | | <if test="applicationId != null">application_id = #{applicationId},</if> |
| | | <if test="commanderId != null">commander_id = #{commanderId},</if> |
| | | </trim> |
| | | where application_id = #{applicationId} |
| | | where soilder_id = #{soilderId} |
| | | </update> |
| | | |
| | | <delete id="deleteArdAppApplicationByApplicationId" parameterType="String"> |
| | | delete from ard_app_application where application_id = #{applicationId} |
| | | <delete id="deleteArdAppApplicationBySoilderId" parameterType="String"> |
| | | delete from ard_app_application where soilder_id = #{soilderId} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdAppApplicationByApplicationIds" parameterType="String"> |
| | | delete from ard_app_application where application_id in |
| | | <foreach item="applicationId" collection="array" open="(" separator="," close=")"> |
| | | #{applicationId} |
| | | <delete id="deleteArdAppApplicationBySoilderIds" parameterType="String"> |
| | | delete from ard_app_application where soilder_id in |
| | | <foreach item="soilderId" collection="array" open="(" separator="," close=")"> |
| | | #{soilderId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <insert id="insertArdAppApplicationList" parameterType="com.ruoyi.app.application.domain.ArdAppApplication" > |
| | | <!--<insert id="insertArdAppApplicationList" parameterType="com.ruoyi.app.application.domain.ArdAppApplication" > |
| | | insert into ard_app_application (application_id,commander_id,soilder_id, |
| | | reason,application_type,begin,state) |
| | | values |
| | |
| | | (#{ardAppApplication.application_id},#{ardAppApplication.commander_id},#{ardAppApplication.soilder_id}, |
| | | #{ardAppApplication.reason},#{ardAppApplication.application_type},#{ardAppApplication.begin},#{ardAppApplication.state}) |
| | | </foreach > |
| | | </insert> |
| | | </insert>--> |
| | | |
| | | <update id="updateArdAppApplicationByCommanderIdAndSoilderIdAndType" parameterType="com.ruoyi.app.application.domain.ArdAppApplication"> |
| | | update ard_app_application set reason = #{reason},begin = #{begin},state = #{state} |
| | | update ard_app_application set reason = #{reason},begin = #{begin},state = #{state},soilder_check = #{soilderCheck} |
| | | where commander_id = #{commanderId} and soilder_id = #{soilderId} and application_type = #{applicationType} |
| | | </update> |
| | | |
| | |
| | | </select> |
| | | |
| | | <update id="updateArdAppApplicationBeginByCommanderIdAndSoilderIdAndType" parameterType="java.lang.String"> |
| | | update ard_app_application set begin = #{begin},state = #{state} |
| | | update ard_app_application set begin = #{begin},state = #{state},soilder_check = 'false' |
| | | where commander_id = #{commanderId} and soilder_id = #{soilderId} and application_type = #{applicationType} |
| | | </update> |
| | | |
| | |
| | | aaa.reason,aaa.begin,aaa.state,aaa.application_type as "applicationType", |
| | | su.user_name as "userName",su.nick_name as "nickName" from ard_app_application aaa |
| | | inner join sys_user su on aaa.soilder_id = su.user_id |
| | | where commander_id = #{usersId} and state = '1' |
| | | where commander_id = #{commanderId} and state = '1' |
| | | </select> |
| | | |
| | | <select id="selectArdAppApplicationBySoilderIdFalse" parameterType="java.lang.String" resultType="java.util.Map"> |
| | | select aaa.soilder_id as "soilderId",aaa.commander_id as "commanderId", |
| | | aaa.reason,aaa.begin,aaa.state,aaa.application_type as "applicationType", |
| | | su.user_name as "userName",su.nick_name as "nickName"from ard_app_application aaa |
| | | inner join sys_user su on aaa.commander_id = su.user_id |
| | | where aaa.soilder_id = #{soilderId} and aaa.soilder_check = 'false' |
| | | and aaa.state != '0' |
| | | </select> |
| | | |
| | | <update id="updateSoilderCheckByCommanderIdAndSoilderIdAndType" parameterType="java.lang.String"> |
| | | update ard_app_application set soilder_check = 'true' |
| | | where commander_id = #{commanderId} and soilder_id = #{soilderId} and application_type = #{applicationType} |
| | | </update> |
| | | </mapper> |