| | |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="deleted" column="deleted"/> |
| | | <result property="keywords" column="keywords"/> |
| | | <result property="sort" column="sort"/> |
| | | <result property="mid" column="mid"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="TjSurveyQuestionTjSurveyOptionsResult" type="TjSurveyQuestion" extends="TjSurveyQuestionResult"> |
| | |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | deleted |
| | | deleted, |
| | | keywords, |
| | | sort, |
| | | mid |
| | | from tj_survey_question |
| | | </sql> |
| | | |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectTjSurveyQuestionByQid" parameterType="Long" |
| | | <select id="selectTjSurveyQuestionByQid" parameterType="String" |
| | | resultMap="TjSurveyQuestionTjSurveyOptionsResult"> |
| | | select a.qid, |
| | | a.question, |
| | |
| | | a.update_by, |
| | | a.update_time, |
| | | a.deleted, |
| | | a.keywords, |
| | | a.sort, |
| | | b.oid as |
| | | sub_oid, |
| | | b.qid as |
| | |
| | | where a.qid = #{qid} |
| | | </select> |
| | | |
| | | <insert id="insertTjSurveyQuestion" parameterType="TjSurveyQuestion" useGeneratedKeys="true" |
| | | keyProperty="qid"> |
| | | |
| | | <select id="getOptionsByMid" parameterType="String" |
| | | resultMap="TjSurveyQuestionTjSurveyOptionsResult"> |
| | | select a.qid, |
| | | a.question, |
| | | a.type, |
| | | a.is_required, |
| | | a.remark, |
| | | a.create_by, |
| | | a.create_time, |
| | | a.update_by, |
| | | a.update_time, |
| | | a.deleted, |
| | | a.keywords, |
| | | a.sort, |
| | | b.oid as |
| | | sub_oid, |
| | | b.qid as |
| | | sub_qid, |
| | | b.ooption as |
| | | sub_ooption, |
| | | b.score as |
| | | sub_score, |
| | | b.remark as |
| | | sub_remark, |
| | | b.create_by as |
| | | sub_create_by, |
| | | b.create_time as |
| | | sub_create_time, |
| | | b.update_by as |
| | | sub_update_by, |
| | | b.update_time as |
| | | sub_update_time, |
| | | b.deleted as |
| | | sub_deleted |
| | | from tj_survey_question a |
| | | left join tj_survey_options b on b.qid = a.qid |
| | | where a.mid = #{mid} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectOptionsByQid" parameterType="String" resultType="TjSurveyOptions"> |
| | | select oid,qid,ooption,score,remark,create_by,create_time,update_by,update_time,deleted from tj_survey_options |
| | | where qid = #{qid} |
| | | </select> |
| | | |
| | | <!-- <insert id="insertTjSurveyQuestion" parameterType="TjSurveyQuestion" useGeneratedKeys="true"--> |
| | | <!-- keyProperty="qid">--> |
| | | <!-- insert into tj_survey_question--> |
| | | <!-- <trim prefix="(" suffix=")" suffixOverrides=",">--> |
| | | <!-- <if test="question != null and question != ''">question,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="type != null and type != ''">type,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="isRequired != null and isRequired != ''">is_required,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="remark != null">remark,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="createBy != null">create_by,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="createTime != null">create_time,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="updateBy != null">update_by,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="updateTime != null">update_time,--> |
| | | <!-- </if>--> |
| | | <!-- <if test="deleted != null">deleted,--> |
| | | <!-- </if>--> |
| | | <!-- </trim>--> |
| | | <!-- <trim prefix="values (" suffix=")" suffixOverrides=",">--> |
| | | <!-- <if test="question != null and question != ''">#{question},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="type != null and type != ''">#{type},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="isRequired != null and isRequired != ''">#{isRequired},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="remark != null">#{remark},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="createBy != null">#{createBy},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="createTime != null">#{createTime},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="updateBy != null">#{updateBy},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="updateTime != null">#{updateTime},--> |
| | | <!-- </if>--> |
| | | <!-- <if test="deleted != null">#{deleted},--> |
| | | <!-- </if>--> |
| | | <!-- </trim>--> |
| | | <!-- </insert>--> |
| | | |
| | | |
| | | <insert id="insertTjSurveyQuestion" parameterType="TjSurveyQuestion"> |
| | | insert into tj_survey_question |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="qid != null and qid != ''">qid, |
| | | </if> |
| | | <if test="question != null and question != ''">question, |
| | | </if> |
| | | <if test="type != null and type != ''">type, |
| | |
| | | </if> |
| | | <if test="updateTime != null">update_time, |
| | | </if> |
| | | <if test="deleted != null">deleted, |
| | | <if test="keywords != null">keywords, |
| | | </if> |
| | | <if test="sort != null">sort, |
| | | </if> |
| | | <if test="mid != null">mid, |
| | | </if> |
| | | |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="question != null and question != ''">#{question}, |
| | | <if test="qid != null and qid != ''">#{qid}, |
| | | </if> |
| | | <if test="question != null and question != ''">#{question}, |
| | | </if> |
| | | <if test="type != null and type != ''">#{type}, |
| | | </if> |
| | |
| | | </if> |
| | | <if test="updateTime != null">#{updateTime}, |
| | | </if> |
| | | <if test="deleted != null">#{deleted}, |
| | | <if test="keywords != null">#{keywords}, |
| | | </if> |
| | | <if test="sort != null">#{sort},</if> |
| | | <if test="mid != null">#{mid},</if> |
| | | |
| | | </trim> |
| | | </insert> |
| | | |
| | | |
| | | <update id="updateTjSurveyQuestion" parameterType="TjSurveyQuestion"> |
| | | update tj_survey_question |
| | |
| | | <if test="deleted != null">deleted = |
| | | #{deleted}, |
| | | </if> |
| | | <if test="mid != null">mid = |
| | | #{mid}, |
| | | </if> |
| | | |
| | | <if test="keywords != null">keywords = |
| | | #{keywords}, |
| | | </if> |
| | | <if test="sort != null">sort = |
| | | #{sort}, |
| | | </if> |
| | | </trim> |
| | | where qid = #{qid} |
| | | </update> |
| | | |
| | | <delete id="deleteTjSurveyQuestionByQid" parameterType="Long"> |
| | | delete |
| | | from tj_survey_question |
| | | where qid = #{qid} |
| | | </delete> |
| | | <update id="deleteTjSurveyQuestionByQid" parameterType="TjSurveyQuestion"> |
| | | update tj_survey_question SET deleted = 1 where qid = #{qid} |
| | | </update> |
| | | |
| | | <delete id="deleteTjSurveyQuestionByQids" parameterType="String"> |
| | | delete from tj_survey_question where qid in |
| | | |
| | | <update id="deleteTjSurveyQuestionByMid" parameterType="Long"> |
| | | update tj_survey_question SET deleted = 1 where mid = #{mid} |
| | | </update> |
| | | |
| | | |
| | | <!-- <delete id="deleteTjSurveyQuestionByQid" parameterType="String">--> |
| | | <!-- delete--> |
| | | <!-- from tj_survey_question--> |
| | | <!-- where qid = #{qid}--> |
| | | <!-- </delete>--> |
| | | |
| | | <update id="deleteTjSurveyQuestionByQids" parameterType="Long"> |
| | | update tj_survey_question set deleted=1 where mid in |
| | | <foreach item="mid" collection="array" open="(" separator="," close=")"> |
| | | #{mid} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <update id="deleteTjSurveyOptionsByQids" parameterType="Long"> |
| | | update tj_survey_options set deleted=1 where qid in |
| | | <foreach item="qid" collection="array" open="(" separator="," close=")"> |
| | | #{qid} |
| | | </foreach> |
| | | </delete> |
| | | </update> |
| | | |
| | | <delete id="deleteTjSurveyOptionsByQids" parameterType="String"> |
| | | delete from tj_survey_options where qid in |
| | | <foreach item="qid" collection="array" open="(" separator="," close=")"> |
| | | #{qid} |
| | | </foreach> |
| | | </delete> |
| | | <!-- <delete id="deleteTjSurveyQuestionByQids" parameterType="String">--> |
| | | <!-- delete from tj_survey_question where qid in--> |
| | | <!-- <foreach item="qid" collection="array" open="(" separator="," close=")">--> |
| | | <!-- #{qid}--> |
| | | <!-- </foreach>--> |
| | | <!-- </delete>--> |
| | | |
| | | <delete id="deleteTjSurveyOptionsByQid" parameterType="Long"> |
| | | delete |
| | | from tj_survey_options |
| | | where qid = #{qid} |
| | | </delete> |
| | | <!-- <delete id="deleteTjSurveyOptionsByQids" parameterType="String">--> |
| | | <!-- delete from tj_survey_options where qid in--> |
| | | <!-- <foreach item="qid" collection="array" open="(" separator="," close=")">--> |
| | | <!-- #{qid}--> |
| | | <!-- </foreach>--> |
| | | <!-- </delete>--> |
| | | |
| | | <insert id="batchTjSurveyOptions"> |
| | | <!-- <delete id="deleteTjSurveyOptionsByQid" parameterType="String">--> |
| | | <!-- delete--> |
| | | <!-- from tj_survey_options--> |
| | | <!-- where qid = #{qid}--> |
| | | <!-- </delete>--> |
| | | |
| | | <update id="deleteTjSurveyOptionsByQid" parameterType="TjSurveyOptions"> |
| | | update tj_survey_options SET deleted = 1 where qid = #{qid} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <insert id="insertTjSurveyOptions" parameterType="TjSurveyOptions"> |
| | | insert into tj_survey_options |
| | | ( oid , qid , ooption , score , remark , create_by , create_time , update_by , update_time , deleted) values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | ( #{item.oid |
| | | }, #{item.qid |
| | | }, #{item.ooption |
| | | }, #{item.score |
| | | }, #{item.remark |
| | | }, #{item.createBy |
| | | }, #{item.createTime |
| | | }, #{item.updateBy |
| | | }, #{item.updateTime |
| | | }, #{item.deleted |
| | | }) |
| | | </foreach> |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="qid != null and qid != ''">qid, |
| | | </if> |
| | | <if test="ooption != null and ooption != ''">ooption, |
| | | </if> |
| | | <if test="score != null and score != ''">score, |
| | | </if> |
| | | <if test="remark != null">remark, |
| | | </if> |
| | | <if test="createBy != null">create_by, |
| | | </if> |
| | | <if test="createTime != null">create_time, |
| | | </if> |
| | | <if test="updateBy != null">update_by, |
| | | </if> |
| | | <if test="updateTime != null">update_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="qid != null and qid != ''">#{qid}, |
| | | </if> |
| | | <if test="ooption != null and ooption != ''">#{ooption}, |
| | | </if> |
| | | <if test="score != null and score != ''">#{score}, |
| | | </if> |
| | | <if test="remark != null">#{remark}, |
| | | </if> |
| | | <if test="createBy != null">#{createBy}, |
| | | </if> |
| | | <if test="createTime != null">#{createTime}, |
| | | </if> |
| | | <if test="updateBy != null">#{updateBy}, |
| | | </if> |
| | | <if test="updateTime != null">#{updateTime}, |
| | | </if> |
| | | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <!-- <insert id="batchTjSurveyOptions">--> |
| | | <!-- insert into tj_survey_options--> |
| | | <!-- ( oid , qid , ooption , score , remark , create_by , create_time , update_by , update_time , deleted) values--> |
| | | <!-- <foreach item="item" index="index" collection="list" separator=",">--> |
| | | <!-- ( #{item.oid--> |
| | | <!-- }, #{item.qid--> |
| | | <!-- }, #{item.ooption--> |
| | | <!-- }, #{item.score--> |
| | | <!-- }, #{item.remark--> |
| | | <!-- }, #{item.createBy--> |
| | | <!-- }, #{item.createTime--> |
| | | <!-- }, #{item.updateBy--> |
| | | <!-- }, #{item.updateTime--> |
| | | <!-- }, #{item.deleted--> |
| | | <!-- })--> |
| | | <!-- </foreach>--> |
| | | <!-- </insert>--> |
| | | </mapper> |