| | |
| | | create_time, |
| | | update_time, |
| | | parent_id, |
| | | (select ca.classify_name from classify_administration as ca where ca.id= classify_administration.parent_id) as parentName, |
| | | (select ca.classify_name from automessage_classify_administration as ca where ca.id= automessage_classify_administration.parent_id) as parentName, |
| | | classify_name, |
| | | classify_icon |
| | | classify_icon, |
| | | (IF(classify_grade = '2',(SELECT count(id) FROM automessage_transaction_event WHERE automessage_transaction_event.classify_id=automessage_classify_administration.id), |
| | | (SELECT count(id) FROM automessage_transaction_event WHERE automessage_transaction_event.classify_id in (SELECT id FROM automessage_classify_administration |
| | | WHERE automessage_classify_administration.parent_id=automessage_transaction_event.classify_id)))) as transactNum |
| | | FROM |
| | | classify_administration |
| | | automessage_classify_administration |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="ClassifyAdministrationEntityResult"> |
| | |
| | | parent_id=#{parentId} |
| | | <if test="departmentId!=null"> |
| | | and id in ( |
| | | select classify_id from transaction_event where department_id=#{departmentId} UNION |
| | | select parent_id from classify_administration where id in (select classify_id FROM transaction_event where department_id=#{departmentId}) ) |
| | | select classify_id from automessage_transaction_event where department_id=#{departmentId} UNION |
| | | select parent_id from automessage_classify_administration |
| | | where id in (select classify_id FROM automessage_transaction_event |
| | | where department_id=#{departmentId})) |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.ClassifyAdministration"> |
| | | insert into classify_administration ( |
| | | insert into automessage_classify_administration ( |
| | | <if test="id != null">id,</if> |
| | | <if test="classifyGrade != null and classifyGrade != '' ">classify_grade,</if> |
| | | <if test="parentId != null">parent_id,</if> |
| | |
| | | </insert> |
| | | |
| | | <update id="updateConfig" parameterType="com.dg.core.db.gen.entity.ClassifyAdministration"> |
| | | update classify_administration |
| | | update automessage_classify_administration |
| | | <set> |
| | | <if test="id != null">id=#{id},</if> |
| | | <if test="classifyGrade != null and classifyGrade != '' ">classify_grade=#{classifyGrade},</if> |
| | |
| | | </update> |
| | | |
| | | <delete id="deleteConfigById" parameterType="String"> |
| | | delete from classify_administration where id= #{id} |
| | | delete from automessage_classify_administration where id= #{id} |
| | | </delete> |
| | | |
| | | <select id="countNum" resultType="integer"> |
| | | select count(id) from classify_administration |
| | | select count(id) from automessage_classify_administration |
| | | <where> |
| | | <if test="classifyName != null and classifyName != ''"> |
| | | AND classify_name like concat('%', #{classifyName}, '%') |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectParent" resultType="string"> |
| | | select id from automessage_classify_administration |
| | | <where> |
| | | <if test="parentId != null and parentId != ''"> |
| | | AND parent_id = #{parentId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectParentData" resultType="com.dg.core.db.gen.entity.ClassifyAdministration"> |
| | | <include refid="selectClassifyAdministrationEntityVo"/> |
| | | <where> |
| | | <if test="parentId != null and parentId != ''"> |
| | | AND parent_id = #{parentId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |